//
//  YGSelectBaseView.m
//  yuanshangyiliao
//
//  Created by icholab on 2021/3/31.
//

#import "YGSelectAniBaseView.h"



@interface YGSelectAniBaseView ()
@property (nonatomic, assign) CGFloat  ani_x;
@property (nonatomic, assign) CGFloat  ani_bottom;
@property (nonatomic, assign) CGFloat  ani_height;


@end
@implementation YGSelectAniBaseView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (CGFloat)ani_x{
    if (_ani_x == 0) {
        _ani_x = self.top;
    }
    return _ani_x;
}

- (CGFloat)ani_bottom{
    if (_ani_bottom == 0) {
        _ani_bottom = self.bottom;
    }
    return _ani_bottom;
}

- (CGFloat)ani_height{
    if (_ani_height == 0) {
        _ani_height = self.height;
    }
    return _ani_height;
}

- (void)show{
    
    [UIView animateWithDuration:0.3 animations:^{
        self.bottom = self.ani_bottom;
//        self.height = self.ani_height;
    }completion:^(BOOL finished) {
        
    }];
}

- (void)hidden{
   
    [UIView animateWithDuration:0.3 animations:^{
        self.top = self.ani_x;
//        self.height = 0;
    }completion:^(BOOL finished) {
        if (self.HiddenSuBlock) {
            self.HiddenSuBlock();
        }
    }];
}

@end
